<?php
declare (strict_types = 1);

namespace app\admin\controller;

use think\Request;

class Res
{
    /**
     * 显示资源列表
     * GET 请求
     *
     * 请求 /res
     *
     * @return \think\Response
     */
    public function index()
    {
        //
        return json(['data' => ['action' => 'index'],'msg' => 'ok','code' => 200]);
    }

    /**
     * 显示创建资源表单页.
     *
     * GET
     * /res/create
     *
     * @return \think\Response
     */
    public function create()
    {
        //
        return json(['data' => ['action' => 'create'],'msg' => 'ok','code' => 200]);
    }

    /**
     * 保存新建的资源
     *
     * POST
     * /res
     *
     * @param  \think\Request  $request
     * @return \think\Response
     */
    public function save(Request $request)
    {
        //
        return json(['data' => ['action' => 'save'],'msg' => 'ok','code' => 200]);
    }

    /**
     * 显示指定的资源
     * GET
     * /res/id值
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function read($id)
    {
        //
        return json(['data' => ['action' => 'read'],'msg' => 'ok','code' => 200]);
    }

    /**
     * 显示编辑资源表单页.
     * /res/1/edit
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function edit($id)
    {
        //
        return json(['data' => ['action' => 'edit'],'msg' => 'ok','code' => 200]);
    }

    /**
     * 保存更新的资源
     * PUT
     * /res/id值
     *
     * @param  \think\Request  $request
     * @param  int  $id
     * @return \think\Response
     */
    public function update(Request $request, $id)
    {
        //
        return json(['data' => ['action' => 'update'],'msg' => 'ok','code' => 200]);
    }

    /**
     * 删除指定资源
     *
     * delete
     * /res/id值
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function delete($id)
    {
        //
        return json(['data' => ['action' => 'delete'],'msg' => 'ok','code' => 200]);
    }
}
